USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[Employee_DeleteEmp]    Script Date: 02/10/2012 11:27:09 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:        TienDH
-- Create date: 12/05/2011
-- Description:    Get full employee's information
-- =============================================
CREATE PROCEDURE [dbo].[Employee_DeleteEmp]
    @Username	NVARCHAR(50)
AS
BEGIN
DECLARE @EmployeeID	BIGINT,
		@VehicleDailyID BIGINT		

SELECT	@EmployeeID = EmployeeID
FROM	Employee
WHERE	Username = @Username

	DELETE FROM Advance
	WHERE EmployeeID = @EmployeeID
	
	DELETE FROM EmployeeSalary
	WHERE EmployeeID = @EmployeeID

    DELETE FROM Employee
    WHERE Username = @Username
END

GO

